package com.jd.controller;

import org.checkerframework.checker.units.qual.A;
import org.springframework.web.bind.annotation.*;

import java.sql.Time;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author wangshuping
 * @version 1.0
 * @date 2021/12/21 11:22
 */
@RestController
@RequestMapping("/degrade")
public class DegradeController {

    @GetMapping("rt/{time}")
    public String rt(@PathVariable Long time) {
        if (Objects.nonNull(time)) {
            try {
                TimeUnit.SECONDS.sleep(time);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        return "rt";
    }
}
